<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*-----------------------------------------------------------------------------------------------
Get_hot_course_block()
-----------------------------------------------------------------------------------------------*/
class Get_new_course_block extends Front_Controller{

	function Get_new_course_block(){
        parent::Front_Controller();
	}
	
	function index(){
        $CI = &get_instance();
		$CI->db->select('c.*,cust.'.CUSTOMERS_IMAGE);
		$CI->db->from(COURSES.' c');		
		$CI->db->join(CUSTOMERS.' cust', 'c.'.COURSES_PROVIDER_ID.' = cust.'.CUSTOMERS_CUSTOMER_ID);		
		$CI->db->order_by(COURSES_START_DATE,1);
		$CI->db->limit(20);
		$q = $CI->db->get();
		$courses = $q->result();
			
		$course_image = base_url().'application/assets/products/1/editor/images/'; 
		$course_image_thumb = base_url().'application/assets/products/1/editor/images/thumb/'; 			
		$this->add('courses', $courses);
		$this->add('course_image', $course_image);
		$this->add('course_image_thumb', $course_image_thumb);
        $this->view('get_hot_course_block');
	}
}